PopupMenu

open class PopupMenu(source)

(SESL variant) Static library support version of the framework's android.widget.PopupMenu. Used to write apps that run on platforms prior to Android 3.0. When running on Android 3.0 or above, this implementation is still used; it does not try to switch to the framework's implementation. See the framework SDK documentation for a class overview.

Constructors

Link copied to clipboard
constructor(@NonNull context: @NonNull Context, @NonNull anchor: @NonNull View)
Constructor to create a new popup menu with an anchor view.
constructor(@NonNull context: @NonNull Context, @NonNull anchor: @NonNull View, gravity: Int)
Constructor to create a new popup menu with an anchor view and alignment gravity.
constructor(@NonNull context: @NonNull Context, @NonNull anchor: @NonNull View, gravity: Int, @AttrRes popupStyleAttr: Int, @StyleRes popupStyleRes: Int)
Constructor a create a new popup menu with a specific style.

Types

Link copied to clipboard
Callback interface used to notify the application that the menu has closed.
Link copied to clipboard
Interface responsible for receiving menu item click events if the items themselves do not have individual item click listeners.

Functions

Link copied to clipboard
open fun dismiss()
Dismiss the menu popup.
Link copied to clipboard
Returns an View.OnTouchListener that can be added to the anchor view to implement drag-to-open behavior.
Link copied to clipboard
open fun getGravity(): Int
Link copied to clipboard
@NonNull
open fun getMenu(): @NonNull Menu
Returns the Menu associated with this popup.
Link copied to clipboard
@NonNull
open fun getMenuInflater(): @NonNull MenuInflater
Link copied to clipboard
open fun inflate(@MenuRes menuRes: Int)
Inflate a menu resource into this PopupMenu.
Link copied to clipboard
Link copied to clipboard
@RequiresApi(value = 17)
open fun seslSetOffset(x: Int, y: Int)
Sets a custom offset for the popup.
Link copied to clipboard
open fun seslSetOverflowOnly(overflowOnly: Boolean)
Link copied to clipboard
open fun seslUpdate()
Link copied to clipboard
open fun setForceShowIcon(forceShowIcon: Boolean)
Sets whether the popup menu's adapter is forced to show icons in the menu item views.
Link copied to clipboard
open fun setGravity(gravity: Int)
Sets the gravity used to align the popup window to its anchor view.
Link copied to clipboard
open fun setOnDismissListener(@Nullable listener: @Nullable PopupMenu.OnDismissListener)
Sets a listener that will be notified when this menu is dismissed.
Link copied to clipboard
open fun setOnMenuItemClickListener(@Nullable listener: @Nullable PopupMenu.OnMenuItemClickListener)
Sets a listener that will be notified when the user selects an item from the menu.
Link copied to clipboard
open fun show()
Show the menu popup anchored to the view specified during construction.